package db

import (
	"github.com/go-redis/redis/v8"
)

// 实现redis连接
func ConnRedis(ip, port, pass string, db int) *redis.Client {
	//实现redis数据库连接
	client := redis.NewClient(&redis.Options{
		Addr:     ip + ":" + port, //redis数据库地址
		Password: pass,            //redis数据库auth密码
		DB:       db,              //redis db0 数据库
	})

	return client
}
